<?php
/**
 +------------------------------------------------------------------------------
 * autoload处理函数
 +----------------------------------------------------------
 * @param string $node 常理节点信息（FILENAME::ARRAY::ARRAYID）
 +----------------------------------------------------------
 * @return void
 +------------------------------------------------------------------------------
 */
function func_autoload($class)
{
	GLOBAL $_FILE_ARRAY;
    $_class = trim($class);
    if(!isset($_FILE_ARRAY[$_class])){
	    if (strlen($_class) > 4 && strtoupper(substr($_class, -4)) === 'TOOL') {
	        require_once TOOL_PATH . $_class . EXT;
	    }
	    
		if (strlen($_class) > 5 && strtoupper(substr($_class, -5)) === 'MODEL') {
	    	require_once MODEL_PATH . $_class . EXT;
		}
		
		if (strlen($_class) > 4 && strtoupper(substr($_class, -4)) === 'CORE') {
	    	require_once CORE_PATH . $_class . EXT;
		}
		$_FILE_ARRAY[$_class] = true;
    }
}

// 注册_autoload
spl_autoload_register('func_autoload');
?>